<template>
  <div>
    <h1>{{ detailsmessage.title }}</h1>
    <div class="stretchNone">
      <div class="stretchNone-author">
        <b>
          <div>编写时间：{{ detailsmessage.createTime }}</div>
        </b>
        <b>
          <div>作者：{{ detailsmessage.author }}</div>
        </b>
      </div>
      <!-- <el-input readonly :rows="26" v-model="details.content" size="small" type="textarea" resize="none"></el-input> -->
      <div v-html="details.content"></div>
    </div>
    <div class="stretchimg" v-show="detailsmessage.picture">
      <el-image :src="detailsmessage.picture" alt="" :preview-src-list="[detailsmessage.picture]" />
    </div>
    <div class="clue">
      <b><span>记录：</span></b>
      <el-timeline :reverse="true">
        <el-timeline-item v-for="(activity, index) in activities" :key="index" :timestamp="activity.time">
          {{ activity.clue }}
        </el-timeline-item>
      </el-timeline>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    detailsmessage: {
      type: Object,
      default() {
        return {}
      },
    },
    activities: {
      type: Array,
      default() {
        return []
      },
    },
  },
  data() {
    return {
      details: {},
    }
  },
  created() {
    this.details = this.detailsmessage
  },
  watch: {
    deep: true,
    detailsmessage(newval, oldval) {
      this.details = newval
    },
  },
}
</script>

<style lang="scss" scoped>
h1 {
  font-weight: 400;
  margin: 0 auto;
  width: 305px;
  text-align: center;
}
.stretchNone {
  width: 809px;
  margin: 0 auto;
  margin-top: 23px;
  .stretchNone-author {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 10px;
  }
}
.stretchimg {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  margin-top: 20px;
  img {
    width: 100%;
    height: 100%;
  }
}
.clue {
  margin: 30px 100px;
}
</style>
